package com.hui.wanxin.web.service.impl;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hui.wanxin.web.entity.Menu;
import com.hui.wanxin.web.entity.PopularScience;
import com.hui.wanxin.web.mapper.MenuMapper;
import com.hui.wanxin.web.service.MenuService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 灰灰
 * @since 2023-10-13
 */
@Service
public class MenuServiceImpl extends ServiceImpl<MenuMapper, Menu> implements MenuService {

    @Override
    public Page<Menu> listByPage(Menu menu) {
        Page<Menu> page = lambdaQuery()
                .eq(menu.getMenuName() != null, Menu::getMenuName, menu.getMenuName())
                .page(new Page<Menu>(menu.getPageNumber(), menu.getPageSize()));
        return page;
    }
}
